<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/react.development.js"></script>
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>
</head>
<body>
    <div id="root"></div>

    <script type="text/babel">
        class Hello extends React.Component{
            // 定义绑定事件的处理方法
            FnHello(){
                alert('hello, '+this.props.name);
            }

            render(){
                return(
                    <input type="button" value="say hello" onClick={this.FnHello.bind(this)}/>
                )
            }
        }
        
        //渲染
        ReactDOM.render(
            <Hello name="tom"/>,
            document.getElementById('root')
        )

    </script>


</body>
</html>